package com.luomu.base.biz.config.logTrace;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;

/**
 * @author liting
 * @desc OpenFeign 全局请求拦截器
 */
@Component
public class FeignRequestInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("traceId", MDC.get("traceId"));
    }
}